package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "查看护理项目")
@RestController("memberNursingController")
@RequestMapping("/member/orders/project")
public class NursingProjectController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    @ApiOperation("查询护理项目列表")
    @GetMapping("/page")
    public TableDataInfo<List<NursingProject>> page(@ApiParam("护理项目查询条件") NursingProject nursingProject) {
        startPage();
        return getDataTable(nursingProjectService.selectNursingProjectList(nursingProject));
    }

    @GetMapping("/{id}")
    public R<NursingProject> getNursingProjectById(@PathVariable Long id) {
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
